'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/api/index_list/top_bar', controller.home.topBar);
  router.get('/api/index_list/:top_id/data/:page_num', controller.home.homeData);
  router.get('/api/search', controller.search.search);
  router.get('/api/shop_list', controller.shopList.getShopList);
  router.get('/api/details/:id', controller.details.getDetails);
  router.get('/api/orders', controller.order.getOrders);
  router.put('/api/update_order', controller.order.upDateOrder);
  router.delete('/api/order', controller.order.deleteOrder);
  router.get('/api/order/:id', controller.order.getOrder);
  router.post('/api/order', controller.order.addOrder);
};
